new Vue({
    el: '#app',
    data() {
      return {
        form: {
          Applicable_Type: "",
          Warehouse_Type: "",
          page: 1,			//页数
          limit: 10			//每页数据条数
        },
        total: 0,
        tableData: [],		//表格数据
      }
    },
    mounted() {
      this.getList(JSON.parse(sessionStorage.getItem('WareDetail')))
    },
    methods: {
      onSerach() {			//查询方法
        this.form.page = 1;
        this.getList(this.form)
      },
      handleSizeChange(val) {
        this.form.page = 1;
        this.form.limit = val;
        this.getList(this.form)
      },
      handleCurrentChange(val) {
        this.form.page = val;
        this.getList(this.form)
      },
      getList(data) {     //换页方法
        const _this = this
        $.ajax({
            url: `${DomainName}/getWarehouseInventoryID?token=${$.cookie('token')}`,
            type: 'POST',
            data: {
              Warehouse_SerialNumber: row.Applicable_Type == '0' ? row.Warehouse_SerialNumber : row.Parent_Warehouse_SerialNumber
            },
            success: function (res) {
              console.log(res);
            },
            dataType: "json"
          });
      },
      handleChildren(row) {
        const _this = this
        $.ajax({
          url: `${DomainName}/getWarehouseInventoryID?token=${$.cookie('token')}`,
          type: 'POST',
          data: {
            Warehouse_SerialNumber: row.Applicable_Type == '0' ? row.Warehouse_SerialNumber : row.Parent_Warehouse_SerialNumber
          },
          success: function (res) {
            console.log(row);
            row.Children.warehouse_inventory = res
          },
          dataType: "json"
        });
      },
    },
  })